@include('admin.header')
<style>
  .search_product {
    max-height:248px;
    overflow-y: scroll;
  }
  .search_product > .item {
    width:80px;
    margin-right:5px;
    float:left;
  }
  .search_product > .item img {
    height:80px;
  }
  .search_product > .item .name {
    height:20px;
    overflow:hidden;
  }

  .order_info {
    display: block;
    margin-top: 5px;
  }
  .line {
    border: 3px dashed #ccc;
    margin-top: 10px;
    margin-bottom: 20px;
  }
</style>
<div class="margin-top-20">
  <form method="post" class="form-horizontal js-ajax-form direct_order_edit_form" action="/globalexchange/direct_order_edit" novalidate="novalidate" enctype ="multipart/form-data">
    <fieldset>
    @foreach($data as $key => $val)
      <div class="control-group"><label class="control-label">钱包ID号</label>
        <div class="controls">
          <span class="order_info">{{$val->purseid or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">钱包类型</label>
        <div class="controls">
          <span class="order_info">
            @if($val->pursetype == 1)
              收益钱包
            @elseif($val->pursetype == 2)
              现金钱包
            @elseif($val->pursetype == 3)
              积分账户
            @elseif($val->pursetype == 97)
              授信账户
            @elseif($val->pursetype == 98)
              中央银行钱包
            @elseif($val->pursetype == 99)
              系统收益钱包
            @endif
          </span>
        </div>
      </div>
      <!-- 子钱包 -->
      <div class="control-group"><label class="control-label">子钱包</label>
        <div class="controls">
          <span class="order_info">
            @if($val->subid == 2)
              购物积分
            @elseif($val->subid == 4)
              GA积分
            @elseif($val->subid == 5)
              惠民积分
            @elseif($val->subid == 6)
              公益积分
            @elseif($val->subid == 7)
              幸运积分
            @endif
          </span>
        </div>
      </div>
      <!-- 钱包余额 -->
      <div class="control-group"><label class="control-label">钱包余额</label>
        <div class="controls">
          <span class="order_info">{{$val->balance}}</span>
        </div>
      </div>
      <!-- 最小金额 -->
      <div class="control-group"><label class="control-label">最小金额</label>
        <div class="controls">
          <span class="order_info">{{$val->minvalue}}</span>
        </div>
      </div>
      <!-- 拥有者类型 -->
      <div class="control-group"><label class="control-label">拥有者类型</label>
        <div class="controls">
          <span class="order_info">
            @if($val->ownertype == 1)
              个人钱包
            @elseif($val->ownertype == 2)
              商店钱包
            @elseif($val->ownertype == 99)
              系统钱包
            @endif
          </span>
        </div>
      </div>
      <!-- 冻结金额 -->
      <div class="control-group"><label class="control-label">冻结金额</label>
        <div class="controls">
          <span class="order_info">{{$val->freezevalue}}</span>
        </div>
      </div>
      <!-- 钱包状态 -->
      <div class="control-group"><label class="control-label">钱包状态</label>
        <div class="controls">
          <span class="order_info">
            @if($val->status == -1)
              全部禁止
            @elseif($val->status == 0)
              全部容许
            @elseif($val->status == 1)
              禁止进账
            @elseif($val->status == 2)
              禁止出账
            @elseif($val->status == 4)
              禁止冻结
            @elseif($val->status == 8)
              禁止解冻
            @endif
          </span>
        </div>
      </div>
      <!-- 钱包编码 -->
      <div class="control-group"><label class="control-label">钱包编码</label>
        <div class="controls">
          <span class="order_info">{{$val->purse_code}}</span>
        </div>
      </div>
      <!-- 分割线 -->
      <div class="line"></div>
    @endforeach
    </fieldset>
  </form>
</div>

<script>
  $(function () {
    $('.direct_order_edit_form').submit(function(){
      var $t = $(this),action=$t.attr('action'),data = $t.serialize();
      post(action,data,function(data){
        _alert('处理成功',function(){
          parent.location.reload();
          parent.layer.close(parent.layer_open2);
        });
      });
      return false;
    });
  });
  
  function product_add(product_id){
    var $t = $('[name=product_id]'),val = $t.val(),vals = val.split(',');
    product_id = product_id + '';
    if(vals.length == 1){
      if(vals[0] == '')
        vals = [];
        }
    if($.inArray(product_id,vals) === -1){
      vals.push(product_id);
      val = vals.join(',');
        }
    $t.val(val);
    }
</script>